import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import index from './views/index'
Vue.use(Router)

export default new Router({
  routes: [
 
      {
        // 启动路径
        path: '/',
        redirect: '/index'
      },
    {
      path: '/index',
      name: 'index',
      component: index,
      
      meta:{index:0},
    },
    {
      path: '/foo',
      name: 'foo',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
      meta:{index:1},

    },
    {
      path: '/bar',
      name: 'foo1',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: Home,
      meta:{index:2},
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/login.vue'),
      meta:{index:3},

    }
  ]
})
